<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>组别添加</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
</head>

<body>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <form action="" method="post" class="form form-horizontal" id="form-admin-role-add" onsubmit="return false">
            <div class="form-group">
                <label class="col-sm-3 control-label">职位名称：</label>
                <div class="col-sm-8">
                    <input id="user_position" name="user_position"  class="form-control" type="text"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">职位描述：</label>
                <div class="col-sm-8">
                    <input id="depict" name="depict"  class="form-control" type="text"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">短期返佣比例：</label>
                <div class="col-sm-8">
                    <input id="ratio" name="ratio"  class="form-control" type="number"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">外汇返佣比例：</label>
                <div class="col-sm-8">
                    <input id="ratio_foreign" name="ratio_foreign"  class="form-control" type="number"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>


            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <button type="button" class="btn btn-success radius"  onclick="Position_Add()" id="admin-role-save" name="admin-role-save">
                        <i class="icon-ok"></i> 确定
                    </button>

                    <a style="margin-left: 20px;" href="position.html" class="btn btn-success btn-warning">
                        <i class="icon-ok"></i> 返回
                    </a>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->

<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<!-- iCheck -->
<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
<!-- Peity -->
<script>

    function Position_Add() {
        var user_position= $("#user_position").val();
        var depict= $("#depict").val();
        var ratio = $("#ratio").val();
        var ratio_foreign = $("#ratio_foreign").val();
        /*var myReg = /^[a-zA-Z0-9_]{0,}$/;
        else if (!myReg.test(user_position)) {
            layer.msg("不能含有中文或特殊字符");
        }*/
        if(!user_position){
            layer.msg('请填写职位名称');
        }else {
            $.post('__MODULE__/System/position_add',{user_position:user_position,depict:depict,ratio:ratio,ratio_foreign:ratio_foreign},function (data) {
                if(data.status==1){
                    layer.msg(data.msg);
                    setTimeout(function(){location.reload();},1000);
                }else if(data.status==0){
                    layer.msg(data.msg);
                }else{
                    layer.msg('网络错误');
                }
            })
        }
    }
</script>
</body>
</html>
